package com.asnike.component{
	
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.system.ApplicationDomain;
	import flash.utils.getDefinitionByName;

	public class StarPoint extends Sprite{
		
		public var star0:StarPointButton;
		public var star1:StarPointButton;
		public var star2:StarPointButton;
		public var star3:StarPointButton;
		public var star4:StarPointButton;
		
		private var _value:int;
		
		public function StarPoint(){
			
		}
		
		public function setValue( $value:int ):void{
			_value = $value;
			setValueStar();
		}
		private function setValueStar():void{
			var i:int, j:int;
			
			for( i = 0, j = 5 ; i < j ; ++i ){
				StarPointButton( getChildByName( 'star' + i ) ).unselect(); 
			}
			for( i = 0, j = _value ; i < j ; ++i ){
				StarPointButton( getChildByName( 'star' + i ) ).select(); 
			}
		}
	}
}